# coding=utf-8
class Solution:
    def lengthOfLongestSubstring(self, s: str) -> int:
        sl = []
        a = ''
        maxlen = 0
        for i in range(len(s)):
            a = ''
            for j in range(i, len(s)):
                if s[j] in a:
                    if len(a) >= maxlen:
                        maxlen = len(a)
                        sl.append(a)
                    break
                else:
                    a += s[j]
                    if len(a) >= maxlen:
                        maxlen = len(a)
                        sl.append(a)

        return maxlen


b = Solution()
print(b.lengthOfLongestSubstring("ffjvbnjksdbflszxhvcxcjhfcvkshflksdhfgds"))
